define(function(require){
	var $ = require("jquery");
	var justep = require("$UI/system/lib/justep");
	var service = require('../js/service');

	var Model = function(){
		this.callParent();
	};

	Model.prototype.submitBtnClick = function(event){
		var name = this.comp("registerNameInput").val();
		var pswd = this.comp("registerPswdInput").val();
		var pswd2 = this.comp("registerPswd2Input").val();
		
		// TODO 这里应该监测name，pswd，pswd1
		if (false) {
			justep.Util.hint('注册信息有误');
		}
		
		// 提交注册
		service.register(name, pswd,
			function(res){
				justep.Util.hint('注册成功，请登录');
				justep.Shell.closePage();
			}
		);
	};

	return Model;
});